import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';

@Component({
  selector: 'app-call-init',
  templateUrl: './call-init.component.html',
  styleUrls: ['./call-init.component.css']
})
export class CallInitComponent implements OnInit {

  room: string = "default-room";
  serverOption: string = "sangatel";

  constructor(
    private router: Router,
  ) { }

  ngOnInit(): void {

  }

  onCallSubmit(){
    console.log("call using server " + this.serverOption);
    console.log("call submit with room name " + this.room);
    let target: string = "jaac";
    if (this.serverOption=="sangatel"){
      target = "/call/jitsi-full-sangatel"
    }  else if (this.serverOption=="jaac"){
      target = "/call/jitsi-full-one"
    }
    this.router.navigate([target, this.room]);
    
  }

  ping(){
    
  }
}
